package com.hungtrung.game;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.hungtrung.script.HungTrungScript;

public class HungTrungGame extends ApplicationAdapter {
	
	private  SpriteBatch batch;	
	Texture img;
	HungTrungScript script;
	
	@Override
	public void create () {
		batch = new SpriteBatch();
	    script = new HungTrungScript();	    
	   // viewport = new StretchViewport(540, 960, camera);
		img = new Texture("images/background.png");							
	}	
	@Override
	public void render () {
		batch.begin();		
		Gdx.gl.glClearColor(0.169f, 0.341f, 0.592f, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		//viewport.update(540, 960, true);				
		//Gdx.graphics.setDisplayMode(1280, 720, true);		
		batch.draw(img, 0, 0);
		script.gameStart(batch);		
		batch.end();		
	}
	
	@Override
	public void dispose(){
		batch.dispose();		
	}
	
	
}
